<template>
    <div class="swiper-container swiper2">
        <div class="swiper-wrapper">
            <div class="swiper-slide" v-for="item of img" :key="item.id">
                <img :src="item.imgUrl" alt="">
            </div>
        </div>
        <div class="swiper-pagination"></div>
    </div>
</template>

<script>
    import Swiper from 'swiper'
    import {getBanner} from "../../../../api";

    export default {
        name: "XinPinShouFaSwiperzxw",
        data(){
            return{
                img:null
            }
        },
        mounted() {
            getBanner('/homexinpinshoufa-swiper')
                .then(response=>{
                    this.img = response.data
                })
        },
        updated() {
            new Swiper('.swiper2', {
                autoplay: true,
                loop: true,
                pagination: {
                    el: '.swiper-pagination',
                    clickable :true,
                },
            });
        },
    }
</script>

<style scoped>
    img{
        width: 100%;
    }
</style>